โ– humdrum codex / glint v1.0.2
license AGPL-3.0
2.0 KB raw
id
TASK-026
title
Preview: table backgrounds + H1 highlight don't match theme paper
status
๐Ÿ Done
assignee
created_date
2026-06-29 22:55
updated_date
2026-06-29 23:12
labels
bug
dependencies
priority
medium
ordinal
26000

Description

Two glamour preview theming bugs:

  1. Table cell padding and border glyphs (โ”‚ โ”ผ โ”€) rendered with no background โ†’ fell back to the terminal-default bg, mismatching the theme paper (worse across themes). Inline-code cells also showed dark blocks.
  2. H1 heading background bar only painted the prefix/suffix margins, not behind the heading text โ€” the word sat on paper bg because applyTheme forced the Text background to paper, overriding the H1 block bg for the heading's child text.

Fix (internal/preview/preview.go): applyTheme now clears all backgrounds and sets only Document/Code/CodeBlock/Table = paper, leaving Text bg unset so heading text inherits the H1 heading bg. Added fillBackground() to re-assert paper bg after every ANSI reset and at line starts, so unstyled gaps (borders, padding) render on paper. Applied to the theme-driven styles only.

Acceptance Criteria

Implementation Notes

Follow-up: real-terminal bleed where unstyled regions adopted the TERMINAL bg (cream-over-dark / dark-over-light). Root: glamour/viewport emit bare \x1b[m resets and viewport padding added AFTER Render. Fixed by re-asserting paper after bare resets too and moving fillBackground to View(). Also left Text.Color unset so H1 text is legible (uses legibleText on the heading bar). 2 more tests. (commit qkvsmknk)